package com.magicsoft.share.adapter.share;

import android.graphics.Paint;
import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.share.Special;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author lyf
 * @date 2017/10/27/027
 * 专题列表
 */

public class SpecialListAdapter extends BaseQuickAdapter<Special, BaseViewHolder> {
    public SpecialListAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, Special item) {

        RoundedImageView imageView = (RoundedImageView) helper.getView(R.id.iv);

        Glide.with(mContext).load(item.getSpecial_img()).into(imageView);
        TextView view = (TextView) helper.getView(R.id.tv_name);
        view.getPaint().setFlags(Paint.FAKE_BOLD_TEXT_FLAG);

        helper
                .setText(R.id.tv_name,item.getSpecial_name())
                .setText(R.id.tv_content,item.getSpecial_describe())
                .setText(R.id.tv_article_num,"文章："+item.getArticle_num())
                .setText(R.id.tv_watch_num,"访问："+item.getVisit_num());

    }
}
